package exception;

/**
 * @classname:UserBlalanceException
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/4 17:34
 * @version: 0.1
 * @since:1.8
 */
public class UserBlalanceException extends RuntimeException {

    //错误码
    //信息
    private int code;
    private String msg;

    public UserBlalanceException(int code, String msg) {
        //自定义类调用父类有参构造才能看到打印出来的信息
        super(code+":"+msg);
    }

    public UserBlalanceException( Throwable cause, int code, String msg) {
        super(msg, cause);
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
